import { Event, UITransform, _decorator, v3, view } from "cc";
import { GameEvent } from "../../Const";
import Orientation from "../utils/Orientation";
const {ccclass}=_decorator
@ccclass
export default class BaseDialog extends Orientation{

    /**
     * 关闭回调
     */
    closeCallback=(data?:any)=>{}
    /**
     * 成功回调
     */
    successCallback=(data?:any)=>{};
    /**
     * 失败回调
     */
    failCallback=()=>{};
    
    onClose():void{
        this.node.dispatchEvent(new Event(GameEvent.CLOSE_POPUP,true))
    }
    sleep():void{
        //this.node.active=false
    }
    wakeUp():void{
        //this.node.active=true
    }
    /**
     * 回调
     * @param name 回调名称
     * @param data 数据
     */
    callBack=(name:string,data?:any)=>{}
}